[PHP-GD] Background transperancy in imagerotate()

Posted by KPL on Stack Overflow See other posts from Stack Overflow or by KPL
Published on 2010-04-22T18:53:04Z Indexed on 2010/04/23 6:03 UTC
Read the original article Hit count: 241

Filed under:
|

Hello people, Since last 2 days, I was trying to add transperancy to the background after rotating an image using imagerotate() PHP-GD function.

But, to my great disappointment, it's not working at all.

It's just giving out a black background behind it.

Here's my code -


$patchImageS    =   'image.png'; // the image to be patched over the final bg
$patchImage =   imagecreatefrompng($patchImageS); // resource of image to be patched
$patchImage     =   imagerotate($patchImage, 23, 0, 0);
imagepng($patchImage,'tt.png');

I tried to change the parameters being passed in function to

imagerotate($patchImage, 23, 5, 0);

imagerotate($patchImage, 23, 0, 5);

Any help would be highly appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about gd